//: Playground - noun: a place where people can play

import Cocoa

//import UIKit

//条件语句 if
var a = 100

if a>100 {
    print(a)
} else if(a<100&&a>0){
    print(a)
} else{
    print(a)
}
//switch
switch a {
    case 1:
        print("a 的值为1")
        fallthrough//如果使用fallthrough语句则会继续执行后面的case或default语句
    case 100...2000:
        print("a 的值为90到100之间")
//        fallthrough//
    case 1..<99:
        print("a 的值小于100")
        fallthrough//
default:
    print("默认case")
}

//for循环
var c :[String] = ["小明","小红"]

for obj in c {
    print(obj)
}

//while
var d = 10
while d<20 {
    print(d)
    d += 1
}

